import { HttpClient } from '@angular/common/http';
import { Inject, Injectable } from '@angular/core';
import { API_CONFIG, ServiceModule } from './service.module';

@Injectable({
  providedIn: ServiceModule
})
export class ArticleService {

  constructor(private http: HttpClient, @Inject(API_CONFIG) private uri: string) { }

  getTop(type: string) {
    let url = this.uri + '/custom/article/top';
    return this.http.post(url, { count: 5, type: type });
  }
}
